//
//  PdfHomeChangePdfCell.m

#import "PdfHomeChangePdfCell.h"
#import "PdfHomeSigleView.h"
static NSString * PdfHomeChangePdfCellId = @"PdfHomeChangePdfCellId";
@interface PdfHomeChangePdfCell()

@end
@implementation PdfHomeChangePdfCell
+ (instancetype)pdfHomeChangePdfCell:(UITableView *)tableView{
    PdfHomeChangePdfCell * pdfHomeChangePdfCell = [tableView dequeueReusableCellWithIdentifier:PdfHomeChangePdfCellId];
    if (!pdfHomeChangePdfCell) {
        pdfHomeChangePdfCell = [[PdfHomeChangePdfCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:PdfHomeChangePdfCellId];
    }
    pdfHomeChangePdfCell.backgroundColor = [UIColor clearColor];
    pdfHomeChangePdfCell.selectionStyle = UITableViewCellSelectionStyleNone;
    pdfHomeChangePdfCell.accessoryType = UITableViewCellAccessoryNone;
    return pdfHomeChangePdfCell;
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self makeSubView];
    }
    return self;
}
- (void)makeSubView{
    PdfWeakSelf
    UIView * pdfHomePdfChangeBgView = [[UIView alloc] init];
    pdfHomePdfChangeBgView.backgroundColor = PdfHex(@"#FFFFFF");
    pdfHomePdfChangeBgView.layer.cornerRadius = PdfRatio(10);
    pdfHomePdfChangeBgView.clipsToBounds = YES;
    [self.contentView addSubview:pdfHomePdfChangeBgView];
    [pdfHomePdfChangeBgView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(PdfRatio(24)));
        make.right.equalTo(@(-PdfRatio(24)));
        make.top.equalTo(@(PdfRatio(0)));
        make.bottom.equalTo(@(-PdfRatio(24)));
    }];
    UILabel * pdfHomePdfChangeHeadLab = [[UILabel alloc] init];
    pdfHomePdfChangeHeadLab.text = @"其他转PDF";
    pdfHomePdfChangeHeadLab.textColor = PdfHex(@"#0E0E0E");
    pdfHomePdfChangeHeadLab.font = [UIFont systemFontOfSize:PdfRatio(30) weight:UIFontWeightBold];
    [pdfHomePdfChangeBgView addSubview:pdfHomePdfChangeHeadLab];
    [pdfHomePdfChangeHeadLab mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(PdfRatio(23)));
        make.top.equalTo(@(PdfRatio(24)));
        make.height.equalTo(@(PdfRatio(42)));
    }];
    UIButton * pdfHomeSigleWorldBtn = [[UIButton alloc] init];
    [pdfHomeSigleWorldBtn setBackgroundImage:[UIImage imageNamed:@"pdfHomeWorldToPDF"] forState:UIControlStateNormal];
    [pdfHomeSigleWorldBtn addTarget:self action:@selector(pdfHomeSigleWorld) forControlEvents:UIControlEventTouchUpInside];
    [pdfHomePdfChangeBgView addSubview:pdfHomeSigleWorldBtn];
    [pdfHomeSigleWorldBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(PdfRatio(53)));
        make.top.equalTo(pdfHomePdfChangeHeadLab.mas_bottom).offset(PdfRatio(36));
        make.width.equalTo(@(PdfRatio(282)));
        make.height.equalTo(@(PdfRatio(65)));
    }];
    UIButton * pdfHomeSigleExcelBtn = [[UIButton alloc] init];
    [pdfHomeSigleExcelBtn setBackgroundImage:[UIImage imageNamed:@"pdfHomeExcelToPDF"] forState:UIControlStateNormal];
    [pdfHomeSigleExcelBtn addTarget:self action:@selector(pdfHomeSigleExcel) forControlEvents:UIControlEventTouchUpInside];
    [pdfHomePdfChangeBgView addSubview:pdfHomeSigleExcelBtn];
    [pdfHomeSigleExcelBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(@(-PdfRatio(53)));
        make.top.equalTo(pdfHomeSigleWorldBtn);
        make.width.equalTo(@(PdfRatio(282)));
        make.height.equalTo(@(PdfRatio(65)));
    }];
    UIButton * pdfHomeSiglePPtBtn = [[UIButton alloc] init];
    [pdfHomeSiglePPtBtn setBackgroundImage:[UIImage imageNamed:@"pdfHomePPtToPDF"] forState:UIControlStateNormal];
    [pdfHomeSiglePPtBtn addTarget:self action:@selector(pdfHomeSiglePPt) forControlEvents:UIControlEventTouchUpInside];
    [pdfHomePdfChangeBgView addSubview:pdfHomeSiglePPtBtn];
    [pdfHomeSiglePPtBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(@(PdfRatio(53)));
        make.top.equalTo(pdfHomeSigleExcelBtn.mas_bottom).offset(PdfRatio(20));
        make.width.equalTo(@(PdfRatio(282)));
        make.height.equalTo(@(PdfRatio(65)));
    }];
    UIButton * pdfHomeSigleImgBtn = [[UIButton alloc] init];
    [pdfHomeSigleImgBtn setBackgroundImage:[UIImage imageNamed:@"pdfHomeImgToPDF"] forState:UIControlStateNormal];
    [pdfHomeSigleImgBtn addTarget:self action:@selector(pdfHomeSigleImg) forControlEvents:UIControlEventTouchUpInside];
    [pdfHomePdfChangeBgView addSubview:pdfHomeSigleImgBtn];
    [pdfHomeSigleImgBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.right.equalTo(@(-PdfRatio(53)));
        make.top.equalTo(pdfHomeSiglePPtBtn);
        make.width.equalTo(@(PdfRatio(282)));
        make.height.equalTo(@(PdfRatio(65)));
    }];
    UIButton * pdfHomeSigleFileBtn = [[UIButton alloc] init];
    [pdfHomeSigleFileBtn setBackgroundImage:[UIImage imageNamed:@"pdfHomeFileToPDF"] forState:UIControlStateNormal];
    [pdfHomeSigleFileBtn addTarget:self action:@selector(pdfHomeSigleFile) forControlEvents:UIControlEventTouchUpInside];
    [pdfHomePdfChangeBgView addSubview:pdfHomeSigleFileBtn];
    [pdfHomeSigleFileBtn mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.equalTo(self);
        make.bottom.equalTo(@(-PdfRatio(29)));
        make.width.equalTo(@(PdfRatio(652)));
        make.height.equalTo(@(PdfRatio(119)));
    }];
}
@end
